
<script>
export default {
  name: 'Audio',
  created () {
    voiceText('中华人民共和国')
    function voiceText (str) {
      const url = 'http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&text=' + encodeURI(str)
      const audio = new Audio(url)
      audio.src = url
      audio.play()
    }
  }
}
</script>

<style scoped>

</style>
